<template>
    <el-form :model="ProjectWorkPlan" label-width="140px" :rules="ProjectWorkPlanrules" ref="AddProjectWorkPlan_refs">
        <el-row>
            <el-col :span="11" :offset="1">
                <el-form-item label="项目工序">
                    <el-input v-model="ProjectWorkPlan.ConstructionProcedure"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="11">
                <el-form-item label="工序内容">
                    <el-input v-model="ProjectWorkPlan.ConstructionContents"></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="11" :offset="1">
                <el-form-item label="工程总量" prop="TotalQuantity">
                    <el-input v-model.number="ProjectWorkPlan.TotalQuantity"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="11">
                <el-form-item label="单价" prop="Price">
                    <el-input v-model.number="ProjectWorkPlan.Price"></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="11" :offset="1">
                <el-form-item label="计划开始工期">
                    <el-date-picker style="width: 100%" placeholder="计划开始工期"
                                    type="date"
                                    value-format="yyyy-MM-dd"
                                    v-model="ProjectWorkPlan.PlanStartDate"></el-date-picker>
                </el-form-item>
            </el-col>
            <el-col :span="11">
                <el-form-item label="计划结束工期">
                    <el-date-picker style="width: 100%" placeholder="计划结束工期"
                                    type="date"
                                    value-format="yyyy-MM-dd"
                                    v-model="ProjectWorkPlan.PlanEndDate"></el-date-picker>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="11" :offset="1">
                <el-form-item label="单位">
                    <el-input v-model="ProjectWorkPlan.Unit"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="11">
                <el-form-item label="计划人员（名）"  prop="Planner">
                    <el-input v-model.number="ProjectWorkPlan.Planner"></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="11" :offset="1">
                <el-form-item label="计划材料（数量）"  prop="PlanningMaterials">
                    <el-input v-model.number="ProjectWorkPlan.PlanningMaterials"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="11">
                <el-form-item label="计划机械（台）" prop="PlanningMachinery">
                    <el-input v-model.number="ProjectWorkPlan.PlanningMachinery"></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="11" :offset="1">
                <el-form-item label="备注">
                    <el-input v-model="ProjectWorkPlan.Remark"></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <el-col align="center">
                <el-button type="success" @click="UpdataWorkPlan">添加</el-button>
            </el-col>
        </el-row>
    </el-form>
</template>

<script>
    export default {
        name: "UpdataProjectWorkPlan",
        props:{
            ProjectWorkPlan:{
                type:Object,
                required:true
            }
        },
        data(){
            return{
                ProjectWorkPlanrules:{
                    TotalQuantity:[ { type:'number', required:true, message:'请输入数字',trigger: 'blur' } ],
                    Price:[ { type:'number', required:true, message:'请输入数字',trigger: 'blur' } ],
                },
            }
        },
        methods:{
            UpdataWorkPlan(){
                this.$http.post('Project1/UpdateProjectWorkPlan',{ projectWorkPlan:this.ProjectWorkPlan }).then(res=>{
                    if (res.data.IsSuccess){
                        this.$message.success(res.data.Msg)
                        this.$parent.$parent.UpdataProjectPlane_dialog.show=false
                    }else{
                        this.$message.warning(res.data.Msg)
                    }
                })
            }
        }
    }
</script>

<style scoped>

</style>
